package cn.com.jonpad.rest;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ConfigClientRest {
	@Value("${spring.application.name}")
	private String applicationName;


	@Value("${eureka.client.service-url.defaultZone}")
	private String eurekaServers;

	@Value("${server.port}")
	private String port;

	@GetMapping("/config")
	public String getConfig(){
		return this.toString();
	}

	@Override
	public String toString() {
		final StringBuffer sb = new StringBuffer("ConfigClientRest{");
		sb.append("applicationName='").append(applicationName).append('\'');
		sb.append(", eurekaServers='").append(eurekaServers).append('\'');
		sb.append(", port='").append(port).append('\'');
		sb.append('}');
		return sb.toString();
	}
}
